package com.wormhole.wormholemanagement.dto;

import com.wormhole.wormholemanagement.entity.NewsPhoto;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class NewsPhotoDTO {
    private Long photoId;
    private String fileNumber;
    private String imagePath;
    private String imageName;
    private String compositeTitle;
    private String imageTitle;
    private String imageFormat;
    private String imageBackground;
    private String imageSize;
    private String imageDpi;
    private String imageScale;
    private String journalists;
    private String shootingDate;
    private String shootingPeriod;
    private String shootingLocation;
    private String eventReason;
    private String organization;
    private Boolean isMovedToArchive;
    private Long operatorId;
    private String createdAt;
    private String updatedAt;
    private String extendedData;
    private Long fileSize;
    private String fileType;
    private String picIs;
    private String orgIssue;
    private String retentionPeriod;
    private String creationDate;

    // 静态转换方法
    public static NewsPhotoDTO fromEntity(NewsPhoto photo) {
        if (photo == null) {
            return null;
        }

        NewsPhotoDTO dto = new NewsPhotoDTO();
        dto.setPhotoId(photo.getPhotoId());
        dto.setFileNumber(photo.getFileNumber());
        dto.setImagePath(photo.getImagePath());
        dto.setImageName(photo.getImageName());
        dto.setCompositeTitle(photo.getCompositeTitle());
        dto.setImageTitle(photo.getImageTitle());
        dto.setImageFormat(photo.getImageFormat());
        dto.setImageBackground(photo.getImageBackground());
        dto.setImageSize(photo.getImageSize());
        dto.setImageDpi(photo.getImageDpi());
        dto.setImageScale(photo.getImageScale());
        dto.setJournalists(photo.getJournalists());
        dto.setShootingDate(photo.getShootingDate());
        dto.setShootingPeriod(photo.getShootingPeriod());
        dto.setShootingLocation(photo.getShootingLocation());
        dto.setEventReason(photo.getEventReason());
        dto.setOrganization(photo.getOrganization());
        dto.setIsMovedToArchive(photo.getIsMovedToArchive());
        dto.setOperatorId(photo.getOperatorId());
        dto.setCreatedAt(photo.getCreatedAt());
        dto.setUpdatedAt(photo.getUpdatedAt());
        dto.setExtendedData(photo.getExtendedData());
        dto.setFileSize(photo.getFileSize());
        dto.setFileType(photo.getFileType());
        dto.setPicIs(photo.getPicIs());
        dto.setOrgIssue(photo.getOrgIssue());
        dto.setRetentionPeriod(photo.getRetentionPeriod());
        dto.setCreationDate(photo.getCreationDate());
        return dto;
    }
}